home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PCTV3N3
/
386OPS.ASM
next >
Wrap
Assembly Source File
|
1992-06-12
|
1KB
|
45 lines
public LongMul386,LongDivMod386,LongShr386,LongShl386,TailPtr
Code segment byte public 'code'
assume cs:Code, ds:Code, ss:Code, es:Code
.386p
ideal
proc LongMul386 far
xchg ax,dx ; Swap high and low words
rol eax,16 ; Move high word to top of register
mov ax,dx ; eax := dx:ax
xchg cx,bx
rol ecx,16
mov cx,bx ; ecx := bx:cx
imul ecx
shld edx,eax,16 ; dx:ax := eax
ret
endp
proc LongDivMod386 far
xchg ax,dx ; Swap high and low words
rol eax,16 ; Move high word to top of register
mov ax,dx ; eax := dx:ax
cdq ; Sign extend!
xchg cx,bx
rol ecx,16
mov cx,bx ; ecx := bx:cx
idiv ecx ; edx:eax := eax mod/div ecx
mov ecx,edx ; The modulus
shld edx,eax,16 ; dx:ax := eax {quotient}
shld ebx,ecx,16 ; bx:cx := ecx {modulus}
ret
endp
proc LongShr386 far
shrd ax,dx,cl
shr dx,cl
ret
endp
proc LongShl386 far
shld dx,ax,cl
shl ax,cl
ret
endp
TailPtr:
ends
end